import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        imgURLPre: 'http://39.108.99.135:9999/files/',
        uploadAction: "http://39.108.99.135:9999/files/upload",
        showcart: false,
        removeCartItem: false,
        checkoutBooks: [],
        showSearch: false,
        seachText: ''
    },
    mutations: {
        changeShowCart(state) {
            state.showcart = !state.showcart
        },
        remove(state) {
            state.removeCartItem = !state.removeCartItem
        },
        setCheckoutBooks(state, books) {
            state.checkoutBooks = books
        },
        Search(state) {
            state.showSearch = !state.showSearch
        },
        setSeachText(state, seachText) {
            state.seachText = seachText
        },
        setSeachTextisNull(state) {
            state.seachText = ''
        },
    },
    actions: {},
    getters: {},
    modules: {}
})